{
  "properties" : { },
  "id" : "df1dc2bd1f32475ca7dc86c6411fc7b9",
  "script" : null,
  "groupId" : "8f5281bc475f40c9b352658edf5fe46b",
  "name" : "获取流程定义的图",
  "createTime" : null,
  "updateTime" : 1744477068991,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "可辉",
  "path" : "definition.svg",
  "method" : "GET",
  "parameters" : [ {
    "name" : "processDefinitionId",
    "value" : "59543012-17be-11f0-96fb-f4b3016ece8b",
    "description" : null,
    "required" : true,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : "",
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"msg\": \"系统内部出现错误\"\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import 'org.activiti.engine.RepositoryService' as repositoryService;
import org.activiti.image.impl.DefaultProcessDiagramGenerator;
import org.activiti.bpmn.model.BpmnModel;
import org.apache.commons.io.IOUtils;

import java.io.InputStream;
import response;

    // 根据流程定义ID获取BPMN模型
    BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);

    // 如果没有特别指定，这里不强调高亮显示任何节点
    InputStream bpmnStream = new DefaultProcessDiagramGenerator().generateDiagram(bpmnModel, "宋体", "宋体", "宋体");

return response.image(IOUtils.toByteArray(bpmnStream), 'image/svg+xml');